/*
 * ------------------------------------------------------------------
 * 封装token操作 模块
 * ------------------------------------------------------------------
 * @关于我：
 * QQ:2815473064
 * wechat:13531609457
 * ------------------------------------------------------------------
 */
import config from "@/config";
let tokenKey = config.localStorage.tokenKey;
import {
  save as StorageSave,
  get as StorageGet,
  remove as StorageRemove,
} from "./localStorage";

export const saveTokenKey = tokenKey;
/**
 * 设置Token
 * **/
export function saveToken(token, tokenExpire) {
  StorageSave({
    key: tokenKey,
    value: token,
    encrypt: true,
    expire: tokenExpire,
  });
}
/**
 *  删除保存的token
 * **/
export function removeToken() {
  StorageRemove(tokenKey);
}
/**
 *  获取Token信息
 * **/
export function getToken() {
  return StorageGet(tokenKey);
}
export default {
  saveTokenKey,
  saveToken,
  removeToken,
  getToken,
};
